home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / X11R4 / cmds / X / include / RCS / servermd.h,v < prev    next >
Encoding:
Text File  |  1990-02-15  |  9.0 KB  |  291 lines

  1. head     1.1;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    tve:1.1; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.1
  10. date     90.02.14.16.17.45;  author tve;  state Exp;
  11. branches ;
  12. next     ;
  13.  
  14.  
  15. desc
  16. @Original X11R4 distribution
  17. @
  18.  
  19.  
  20.  
  21. 1.1
  22. log
  23. @Initial revision
  24. @
  25. text
  26. @/***********************************************************
  27. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
  28. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  29.  
  30.                         All Rights Reserved
  31.  
  32. Permission to use, copy, modify, and distribute this software and its 
  33. documentation for any purpose and without fee is hereby granted, 
  34. provided that the above copyright notice appear in all copies and that
  35. both that copyright notice and this permission notice appear in 
  36. supporting documentation, and that the names of Digital or MIT not be
  37. used in advertising or publicity pertaining to distribution of the
  38. software without specific, written prior permission.  
  39.  
  40. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  41. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  42. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  43. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  44. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  45. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  46. SOFTWARE.
  47.  
  48. ******************************************************************/
  49. #ifndef SERVERMD_H
  50. #define SERVERMD_H 1
  51. /* $XConsortium: servermd.h,v 1.48 89/12/06 16:56:14 rws Exp $ */
  52.  
  53. /*
  54.  * The vendor string identifies the vendor responsible for the
  55.  * server executable.
  56.  */
  57. #ifndef VENDOR_STRING
  58. #define VENDOR_STRING "MIT X Consortium"
  59. #endif
  60.  
  61. /*
  62.  * The vendor release number identifies, for the purpose of submitting
  63.  * traceable bug reports, the release number of software produced
  64.  * by the vendor.
  65.  */
  66. #ifndef VENDOR_RELEASE
  67. #define VENDOR_RELEASE    4
  68. #endif
  69.  
  70. /*
  71.  * Machine dependent values:
  72.  * GLYPHPADBYTES should be chosen with consideration for the space-time
  73.  * trade-off.  Padding to 0 bytes means that there is no wasted space
  74.  * in the font bitmaps (both on disk and in memory), but that access of
  75.  * the bitmaps will cause odd-address memory references.  Padding to
  76.  * 2 bytes would ensure even address memory references and would
  77.  * be suitable for a 68010-class machine, but at the expense of wasted
  78.  * space in the font bitmaps.  Padding to 4 bytes would be good
  79.  * for real 32 bit machines, etc.  Be sure that you tell the font
  80.  * compiler what kind of padding you want because its defines are
  81.  * kept separate from this.  See server/include/font.h for how
  82.  * GLYPHPADBYTES is used.
  83.  *
  84.  * Along with this, you should choose an appropriate value for
  85.  * GETLEFTBITS_ALIGNMENT, which is used in ddx/mfb/maskbits.h.  This
  86.  * constant choses what kind of memory references are guarenteed during
  87.  * font access; either 1, 2 or 4, for byte, word or longword access,
  88.  * respectively.  For instance, if you have decided to to have
  89.  * GLYPHPADBYTES == 4, then it is pointless for you to have a
  90.  * GETLEFTBITS_ALIGNMENT > 1, because the padding of the fonts has already
  91.  * guarenteed you that your fonts are longword aligned.  On the other
  92.  * hand, even if you have chosen GLYPHPADBYTES == 1 to save space, you may
  93.  * also decide that the computing involved in aligning the pointer is more
  94.  * costly than an odd-address access; you choose GETLEFTBITS_ALIGNMENT == 1.
  95.  *
  96.  * Next, choose the tuning parameters which are appropriate for your
  97.  * hardware; these modify the behaviour of the raw frame buffer code
  98.  * in ddx/mfb and ddx/cfb.  Defining these incorrectly will not cause
  99.  * the server to run incorrectly, but defining these correctly will
  100.  * cause some noticeable speed improvements:
  101.  *
  102.  *  AVOID_MEMORY_READ - (8-bit cfb only)
  103.  *    When stippling pixels on the screen (polytext and pushpixels),
  104.  *    don't read long words from the display and mask in the
  105.  *    appropriate values.  Rather, perform multiple byte/short/long
  106.  *    writes as appropriate.  This option uses many more instructions
  107.  *    but runs much faster when the destination is much slower than
  108.  *    the CPU and at least 1 level of write buffer is availible (2
  109.  *    is much better).  Defined currently for SPARC and MIPS.
  110.  *
  111.  *  FAST_CONSTANT_OFFSET_MODE - (cfb and mfb)
  112.  *    This define is used on machines which have no auto-increment
  113.  *    addressing mode, but do have an effectively free constant-offset
  114.  *    addressing mode.  Only MIPS uses this currently.
  115.  *    
  116.  *  LARGE_INSTRUCTION_CACHE -
  117.  *    This define increases the number of times some loops are
  118.  *    unrolled.  On 68020 machines (with 256 bytes of i-cache),
  119.  *    this define will slow execution down as instructions miss
  120.  *    the cache frequently.  On machines with real i-caches, this
  121.  *    reduces loop overhead, causing a slight performance improvement.
  122.  *    Currently defined for MIPS and SPARC
  123.  */
  124.  
  125. #ifdef vax
  126.  
  127. #define IMAGE_BYTE_ORDER    LSBFirst        /* Values for the VAX only */
  128. #define BITMAP_BIT_ORDER    LSBFirst
  129. #define    GLYPHPADBYTES        1
  130. #define GETLEFTBITS_ALIGNMENT    4
  131.  
  132. #endif /* vax */
  133.  
  134. #ifdef sun
  135.  
  136. #if defined(sun386) || defined(sun5)
  137. # define IMAGE_BYTE_ORDER    LSBFirst        /* Values for the SUN only */
  138. # define BITMAP_BIT_ORDER    LSBFirst
  139. #else
  140. # define IMAGE_BYTE_ORDER    MSBFirst        /* Values for the SUN only */
  141. # define BITMAP_BIT_ORDER    MSBFirst
  142. #endif
  143.  
  144. #ifdef sparc
  145. # define AVOID_MEMORY_READ
  146. # define LARGE_INSTRUCTION_CACHE
  147. #endif
  148.  
  149. #define    GLYPHPADBYTES        4
  150. #define GETLEFTBITS_ALIGNMENT    1
  151.  
  152. #endif /* sun */
  153.  
  154. #ifdef apollo
  155.  
  156. #define IMAGE_BYTE_ORDER    MSBFirst        /* Values for the Apollo only*/
  157. #define BITMAP_BIT_ORDER    MSBFirst
  158. #define    GLYPHPADBYTES        2
  159. #define GETLEFTBITS_ALIGNMENT    4
  160.  
  161. #endif /* apollo */
  162.  
  163. #if defined(ibm032) || defined (ibm)
  164.  
  165. #ifdef i386
  166. # define IMAGE_BYTE_ORDER    LSBFirst    /* Value for PS/2 only */
  167. #else
  168. # define IMAGE_BYTE_ORDER    MSBFirst        /* Values for the RT only*/
  169. #endif
  170. #define BITMAP_BIT_ORDER    MSBFirst
  171. #define    GLYPHPADBYTES        1
  172. #define GETLEFTBITS_ALIGNMENT    4
  173. /* ibm pcc doesn't understand pragmas. */
  174.  
  175. #endif /* ibm */
  176.  
  177. #ifdef hpux
  178.  
  179. #define IMAGE_BYTE_ORDER    MSBFirst        /* Values for the HP only */
  180. #define BITMAP_BIT_ORDER    MSBFirst
  181. #define    GLYPHPADBYTES        4
  182. #define    GETLEFTBITS_ALIGNMENT    1
  183.  
  184. #endif /* hpux */
  185.  
  186. #if defined(M4315) || defined(M4317) || defined(M4319) || defined(M4330)
  187.  
  188. #define IMAGE_BYTE_ORDER    MSBFirst        /* Values for Pegasus only */
  189. #define BITMAP_BIT_ORDER    MSBFirst
  190. #define GLYPHPADBYTES        4
  191. #define GETLEFTBITS_ALIGNMENT    1
  192.  
  193. #endif /* tektronix */
  194.  
  195. #ifdef macII
  196.  
  197. #define IMAGE_BYTE_ORDER          MSBFirst        /* Values for the MacII only */
  198. #define BITMAP_BIT_ORDER          MSBFirst
  199. #define GLYPHPADBYTES             4
  200. #define GETLEFTBITS_ALIGNMENT     1
  201.  
  202. #endif /* macII */
  203.  
  204. #ifdef mips
  205.  
  206. #ifdef MIPSEL
  207. # define IMAGE_BYTE_ORDER    LSBFirst        /* Values for the PMAX only */
  208. # define BITMAP_BIT_ORDER    LSBFirst
  209. # define GLYPHPADBYTES        4
  210. # define GETLEFTBITS_ALIGNMENT    1
  211. #else
  212. # define IMAGE_BYTE_ORDER    MSBFirst        /* Values for the MIPS only */
  213. # define BITMAP_BIT_ORDER    MSBFirst
  214. # define GLYPHPADBYTES        4
  215. # define GETLEFTBITS_ALIGNMENT    1
  216. #endif
  217.  
  218. #define AVOID_MEMORY_READ
  219. #define FAST_CONSTANT_OFFSET_MODE
  220. #define LARGE_INSTRUCTION_CACHE
  221.  
  222. #endif /* mips */
  223.  
  224. #ifdef stellar
  225.  
  226. #define IMAGE_BYTE_ORDER    MSBFirst       /* Values for the stellar only*/
  227. #define BITMAP_BIT_ORDER    MSBFirst
  228. #define    GLYPHPADBYTES        4
  229. #define GETLEFTBITS_ALIGNMENT    4
  230. /*
  231.  * Use SysV random number generator.
  232.  */
  233. #define random rand
  234.  
  235. #endif /* stellar */
  236.  
  237. /* size of buffer to use with GetImage, measured in bytes. There's obviously
  238.  * a trade-off between the amount of stack (or whatever ALLOCATE_LOCAL gives
  239.  * you) used and the number of times the ddx routine has to be called.
  240.  * 
  241.  * for a 1024 x 864 bit monochrome screen  with a 32 bit word we get 
  242.  * 8192/4 words per buffer 
  243.  * (1024/32) = 32 words per scanline
  244.  * 2048 words per buffer / 32 words per scanline = 64 scanlines per buffer
  245.  * 864 scanlines / 64 scanlines = 14 buffers to draw a full screen
  246.  */
  247. #if defined(stellar)
  248. #define IMAGE_BUFSIZE        (64*1024)
  249. #else
  250. #define IMAGE_BUFSIZE        8192
  251. #endif
  252.  
  253. /* pad scanline to a longword */
  254. #if defined(ibm) && defined(i386)
  255. #define BITMAP_SCANLINE_UNIT    8
  256. #else
  257. #define BITMAP_SCANLINE_UNIT    32
  258. #endif
  259. #define BITMAP_SCANLINE_PAD  32
  260.  
  261. #define LOG2_BITMAP_PAD        5
  262. #define LOG2_BYTES_PER_SCANLINE_PAD    2
  263.  
  264. /* 
  265.  *   This returns the number of padding units, for depth d and width w.
  266.  * For bitmaps this can be calculated with the macros above.
  267.  * Other depths require either grovelling over the formats field of the
  268.  * screenInfo or hardwired constants.
  269.  */
  270.  
  271. typedef struct _PaddingInfo {
  272.     int     padRoundUp;    /* pixels per pad unit - 1 */
  273.     int    padPixelsLog2;    /* log 2 (pixels per pad unit) */
  274.     int     padBytesLog2;    /* log 2 (bytes per pad unit) */
  275. } PaddingInfo;
  276. extern PaddingInfo PixmapWidthPaddingInfo[];
  277.  
  278. #define PixmapWidthInPadUnits(w, d) \
  279.     (((w) + PixmapWidthPaddingInfo[d].padRoundUp) >> \
  280.     PixmapWidthPaddingInfo[d].padPixelsLog2)
  281.  
  282. /*
  283.  *    Return the number of bytes to which a scanline of the given
  284.  * depth and width will be padded.
  285.  */
  286. #define PixmapBytePad(w, d) \
  287.     (PixmapWidthInPadUnits(w, d) << PixmapWidthPaddingInfo[d].padBytesLog2)
  288.  
  289. #endif /* SERVERMD_H */
  290. @
  291.